package android.slc.appbase.ui.vd;

import java.io.Serializable;

/**
 * 基础的列表盒子vm
 *
 * @author slc
 * @date 2020-08-25 16:13
 */
public abstract class BaseListCommonVd<T extends Serializable, VB extends BaseListCommonVmBox<T>> extends BaseDataChangeVd<VB> {

    protected OnAdapterItemClickListener<T> onAdapterItemClickListener;

    protected void initView() {
        super.initView();
        initSwipeRecycler();
    }

    public void setOnAdapterItemClickListener(OnAdapterItemClickListener<T> onAdapterItemClickListener) {
        this.onAdapterItemClickListener = onAdapterItemClickListener;
    }

    /**
     * 遇到数据加载失败但是List<>有数据时多半是此处的问题，根据问题所在重写该方法即可
     */
    protected void initSwipeRecycler() {
        //初始化列表数据
    }


    protected void notifyRefreshing() {

    }

    public interface OnAdapterItemClickListener<T extends Serializable> {
        void onItemClick(T item);
    }
}
